// just add it to the bottom of their 'sidebar' element as a fallback
switch ( mw.config.get( 'skin' ) ) {
case 'standard':
- case 'cologneblue':
$( '#quickbar' ).append( $link.after( '<br/>' ) );
return $link[0];
case 'nostalgia':
?>
<div id="content">
<div id="topbar">
- <p id="sitetitle">
+ <p id="sitetitle" role="banner">
<a href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>">
<?php echo wfMessage( 'sitetitle' )->escaped() ?>
</a>
</p>
<p id="sitesub"><?php echo wfMessage( 'sitesubtitle' )->escaped() ?></p>
- <div id="toplinks">
+ <div id="toplinks" role="navigation">
<p id="syslinks"><?php echo $this->sysLinks() ?></p>
<p id="variantlinks"><?php echo $this->variantLinks() ?></p>
</div>
- <div id="linkcollection">
+ <div id="linkcollection" role="navigation">
<div id="langlinks"><?php echo str_replace( '<br />', '', $this->otherLanguages() ) ?></div>
<?php echo $this->getSkin()->getCategories() ?>
<div id="titlelinks"><?php echo $this->pageTitleLinks() ?></div>
<?php } ?>
</div>
</div>
- <div id="article">
+ <div id="article" role="main">
<?php if ( $this->getSkin()->getSiteNotice() ) { ?>
<div id="siteNotice"><?php echo $this->getSkin()->getSiteNotice() ?></div>
<?php } ?>
ob_start();
?>
</div>
- <div id='footer'>
+ <div id="footer" role="contentinfo">
<?php
// Page-related links
echo $this->bottomLinks();
$qbmyoptions[$key] = null;
}
- $bar['qbedit'] = $qbedit;
- $bar['qbpageoptions'] = $qbpageoptions;
- $bar['qbmyoptions'] = $qbmyoptions;
+ // Use the closest reasonable name
+ $bar['cactions'] = $qbedit;
+ $bar['pageoptions'] = $qbpageoptions; // this is a non-standard portlet name, but nothing fits
+ $bar['personal'] = $qbmyoptions;
return $bar;
}
$bar = array();
foreach ( $orig_bar as $heading => $data ) {
if ( $heading == 'SEARCH' ) {
- $bar['qbfind'] = $this->searchForm( 'sidebar' );
+ $bar['search'] = $this->searchForm( 'sidebar' );
} elseif ( $heading == 'TOOLBOX' ) {
- $bar['toolbox'] = $this->getToolbox();
- } elseif ( $heading == 'navigation' ) {
- // Use the navigation heading from standard sidebar as the "browse" section
- $bar['qbbrowse'] = $data;
+ $bar['tb'] = $this->getToolbox();
} else {
$bar[$heading] = $data;
}
// Output the sidebar
+ // CologneBlue uses custom messages for some portlets, but we should keep the ids for consistency
+ $idToMessage = array(
+ 'search' => 'qbfind',
+ 'navigation' => 'qbbrowse',
+ 'tb' => 'toolbox',
+ 'cactions' => 'qbedit',
+ 'personal' => 'qbmyoptions',
+ 'pageoptions' => 'qbpageoptions',
+ );
+
$s = "<div id='quickbar'>\n";
foreach ( $bar as $heading => $data ) {
- $headingMsg = wfMessage( $heading );
- $headingHTML = "<h6>" . ( $headingMsg->exists() ? $headingMsg->escaped() : htmlspecialchars( $heading ) ) . "</h6>";
$portletId = Sanitizer::escapeId( "p-$heading" );
+ $headingMsg = wfMessage( $idToMessage[$heading] ? $idToMessage[$heading] : $heading );
+ $headingHTML = "<h6>" . ( $headingMsg->exists() ? $headingMsg->escaped() : htmlspecialchars( $heading ) ) . "</h6>";
$listHTML = "";
if ( is_array( $data ) ) {
}
if ( $listHTML ) {
- $s .= "<div class=\"portlet\" id=\"$portletId\">\n$headingHTML\n$listHTML\n</div>\n";
+ $role = ( $heading == 'search' ) ? 'search' : 'navigation';
+ $s .= "<div class=\"portlet\" id=\"$portletId\" role=\"$role\">\n$headingHTML\n$listHTML\n</div>\n";
}
}
<?php $this->cactions(); ?>
<!-- content -->
- <div id="mw_content">
+ <div id="mw_content" role="main">
<!-- contentholder does nothing by default, but it allows users to style the text inside
the content area without affecting the meaning of 'em' in #mw_content, which is used
for the margins -->
<div class="mw_clear"></div>
<!-- personal portlet -->
- <div class="portlet" id="p-personal">
+ <div class="portlet" id="p-personal" role="navigation">
<h5><?php $this->msg('personaltools') ?></h5>
<div class="pBody">
<ul>
<!-- footer -->
- <div id="footer"<?php $this->html('userlangattributes') ?>>
+ <div id="footer" role="contentinfo"<?php $this->html('userlangattributes') ?>>
<ul id="f-list">
<?php
foreach( $this->getFooterLinks("flat") as $aLink ) {
$this->html( 'headelement' );
?><div id="globalWrapper">
-<div id="column-content"><div id="content" class="mw-body-primary">
+<div id="column-content"><div id="content" class="mw-body-primary" role="main">
<a id="top"></a>
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
</div></div>
<div id="column-one"<?php $this->html('userlangattributes') ?>>
<?php $this->cactions(); ?>
- <div class="portlet" id="p-personal">
+ <div class="portlet" id="p-personal" role="navigation">
<h5><?php $this->msg('personaltools') ?></h5>
<div class="pBody">
<ul<?php $this->html('userlangattributes') ?>>
</ul>
</div>
</div>
- <div class="portlet" id="p-logo">
+ <div class="portlet" id="p-logo" role="banner">
<?php
echo Html::element( 'a', array(
'href' => $this->data['nav_urls']['mainpage']['href'],
$validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links
if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) { ?>
-<div id="footer"<?php $this->html('userlangattributes') ?>>
+<div id="footer" role="contentinfo"<?php $this->html('userlangattributes') ?>>
<?php
$footerEnd = '</div>';
} else {
function searchBox() {
global $wgUseTwoButtonsSearchForm;
?>
- <div id="p-search" class="portlet">
+ <div id="p-search" class="portlet" role="search">
<h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
<div id="searchBody" class="pBody">
<form action="<?php $this->text('wgScript') ?>" id="searchform">
*/
function cactions() {
?>
- <div id="p-cactions" class="portlet">
+ <div id="p-cactions" class="portlet" role="navigation">
<h5><?php $this->msg('views') ?></h5>
<div class="pBody">
<ul><?php
/*************************************************************************************************/
function toolbox() {
?>
- <div class="portlet" id="p-tb">
+ <div class="portlet" id="p-tb" role="navigation">
<h5><?php $this->msg('toolbox') ?></h5>
<div class="pBody">
<ul>
function languageBox() {
if( $this->data['language_urls'] ) {
?>
- <div id="p-lang" class="portlet">
+ <div id="p-lang" class="portlet" role="navigation">
<h5<?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5>
<div class="pBody">
<ul>
* @param $cont array|string
*/
function customBox( $bar, $cont ) {
- $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ) );
+ $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ), 'role' => 'navigation' );
$tooltip = Linker::titleAttrib( "p-$bar" );
if ( $tooltip !== false ) {
$portletAttribs['title'] = $tooltip;
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<!-- content -->
- <div id="content" class="mw-body">
+ <div id="content" class="mw-body" role="main">
<a id="top"></a>
<div id="mw-js-message" style="display:none;"<?php $this->html( 'userlangattributes' ) ?>></div>
<?php if ( $this->data['sitenotice'] ): ?>
<!-- panel -->
<div id="mw-panel" class="noprint">
<!-- logo -->
- <div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) ?>></a></div>
+ <div id="p-logo" role="banner"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) ?>></a></div>
<!-- /logo -->
<?php $this->renderPortals( $this->data['sidebar'] ); ?>
</div>
<!-- /panel -->
<!-- footer -->
- <div id="footer"<?php $this->html( 'userlangattributes' ) ?>>
+ <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>>
<?php foreach( $this->getFooterLinks() as $category => $links ): ?>
<ul id="footer-<?php echo $category ?>">
<?php foreach( $links as $link ): ?>
$msg = $name;
}
?>
-<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo Linker::tooltip( 'p-' . $name ) ?>>
+<div class="portal" role="navigation" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo Linker::tooltip( 'p-' . $name ) ?>>
<h5<?php $this->html( 'userlangattributes' ) ?>><?php $msgObj = wfMessage( $msg ); echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg ); ?></h5>
<div class="body">
<?php
switch ( $element ) {
case 'NAMESPACES':
?>
-<div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-namespaces" role="navigation" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg( 'namespaces' ) ?></h5>
<ul<?php $this->html( 'userlangattributes' ) ?>>
<?php foreach ( $this->data['namespace_urls'] as $link ): ?>
break;
case 'VARIANTS':
?>
-<div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-variants" role="navigation" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h4>
<?php foreach ( $this->data['variant_urls'] as $link ): ?>
<?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
break;
case 'VIEWS':
?>
-<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>">
+<div id="p-views" role="navigation" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>">
<h5><?php $this->msg('views') ?></h5>
<ul<?php $this->html('userlangattributes') ?>>
<?php foreach ( $this->data['view_urls'] as $link ): ?>
break;
case 'ACTIONS':
?>
-<div id="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-cactions" role="navigation" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><span><?php $this->msg( 'actions' ) ?></span><a href="#"></a></h5>
<div class="menu">
<ul<?php $this->html( 'userlangattributes' ) ?>>
break;
case 'PERSONAL':
?>
-<div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-personal" role="navigation" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg( 'personaltools' ) ?></h5>
<ul<?php $this->html( 'userlangattributes' ) ?>>
<?php
break;
case 'SEARCH':
?>
-<div id="p-search">
+<div id="p-search" role="search">
<h5<?php $this->html( 'userlangattributes' ) ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
<form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
<?php if ( $wgVectorUseSimpleSearch && $this->getSkin()->getUser()->getOption( 'vector-simplesearch' ) ): ?>